<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit|ie-comp|ie-stand">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <!--[if lt IE 9]>
  <script type="text/javascript" src="{__STATIC_PATH}admin/lib/html5.js"></script>
  <script type="text/javascript" src="{__STATIC_PATH}admin/lib/respond.min.js"></script>
  <![endif]-->
  <link rel="stylesheet" type="text/css" href="{__STATIC_PATH}admin/static/h-ui/css/H-ui.css" />
  <link rel="stylesheet" type="text/css" href="{__STATIC_PATH}admin/static/h-ui.admin.pro.iframe/css/H-ui.login.css" />
  <link rel="stylesheet" type="text/css" href="{__STATIC_PATH}admin/lib/Hui-iconfont/1.0.9/iconfont.css" />
  <link rel="stylesheet" type="text/css" href="{__STATIC_PATH}admin/static/business/css/style.css" />
  <!--[if IE 6]>
  <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
  <script>DD_belatedPNG.fix('*');</script><![endif]-->
  <title>首页</title>
</head>
<body>
  <input type="hidden" id="TenantId" name="TenantId" value="" />
  <div class="header"></div>
  <div class="loginWraper">
  </div>
  <div class="footer"><a href="https://beian.miit.gov.cn/" target="_blank">备案号(京ICP备2021000259号-1)</a></div>

  <script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery/1.9.1/jquery.min.js"></script>
  <script type="text/javascript" src="{__STATIC_PATH}admin/static/h-ui/js/H-ui.js"></script>
  <script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
  <script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
  <script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
  <script type="text/javascript" src="{__STATIC_PATH}admin/lib/layer/3.1.1/layer.js"></script>
  <script type="text/javascript">
    $(function(){
      /* 表单验证，提交 */
      $("#form-admin-login").validate({
        rules: {
          name: {
            required:true,
          },
          password: {
            required:true,
            rangelength: [6, 16]
          },
          // verify: {
          //   required:true,
          // }
        },
        messages: {
          name: {
            required: "账户不能为空"
          },
          password: {
            required: "密码不能为空",
            rangelength: "密码长度6到16个字符"
          },
          // verify: {
          //   required: "验证码不能为空"
          // },
        },
        onkeyup: false,
        focusCleanup: false,
        submitHandler: function(form) {
          //在这里执行表单提交
          $.ajax({
            url:"login",
            type:"post",
            data:$("form").serialize(),
            success:function (res){
              console.log(res)
                if (res.code==1){
                  layer.msg('登录成功',{icon:1,time:1000})
                  setTimeout(function() { window.location.href =res.result.url}, 1100 );
                }else {
                  layer.msg(res.msg,{icon:2,time:1000});
                }
            }
          })
        }
      });
    });
  </script>
</body>
</html>
